﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PiaoanWeb.AppLogic.BusinessLogicLayer;
using PiaoanWeb.AppLogic.DataAccessLayer;
using PiaoanWeb.Helpers;
namespace PiaoanWeb.Admin
{
    public partial class ViewNews : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                NewsBLL newsBLL = new NewsBLL();
                News news = newsBLL.GetNewsByID(Convert.ToInt32(Request.QueryString["NewsID"]));
                titleLbl.Text = news.Title;
                contentLbl.Text = WebUtility.HtmlDecode(news.Content);
            }
        }

        protected void editNewsBtn_Click(object sender, EventArgs e)
        {
            Response.Redirect("EditNews.aspx?NewsID="+Request.QueryString["NewsID"]);
        }

        protected void backNewsBtn_Click(object sender, EventArgs e)
        {
            Response.Redirect("NewsList.aspx");
        }
    }
}